﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Xml;

namespace WQ.Common
{
    public class CookieHelper
    {
        private CookieHelper() { }

        public static void SetCookie(string strName, string strValue)
        {
            HttpCookie _creatCookie = new HttpCookie(strName, strValue);
            HttpContext.Current.Response.AppendCookie(_creatCookie);
        }

        public static string GetCookie(string strName)
        {
            if (HttpContext.Current.Request.Cookies[strName] == null)
            {
                return string.Empty;
            }
            else
            {
                return HttpContext.Current.Request.Cookies[strName].Value.ToString().Trim();
            }
        }
    }
}
